package com.jack.vipmis.vip.card.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.jack.vipmis.common.entity.enums.BooleanEnum;
import com.jack.vipmis.common.web.controller.BaseCRUDController;
import com.jack.vipmis.vip.business.service.BusinessService;
import com.jack.vipmis.vip.card.entity.Card;
import com.jack.vipmis.vip.card.service.CardTypeService;

/**
 * 
 * @author JackLiang
 * @date 2014-6-5
 * @version 1.0
 */
@Controller
@RequestMapping(value = "/vip/card")
public class CardController extends BaseCRUDController<Card, Long> {

	@Autowired
	private CardTypeService	cardTypeService;

	@Autowired
	private BusinessService	businessService;

	public CardController() {
		setResourceIdentity("vip:card");
	}

	@Override
	protected void setCommonData(Model model) {
		model.addAttribute("cardTypes", cardTypeService.findAll());
		model.addAttribute("booleanList", BooleanEnum.values());
		model.addAttribute("business", businessService.findAll());
	}

}
